package org.hcyspartnoc.demo.common.core.config.exceptionHandler;

import org.hcyspartnoc.demo.common.core.AjaxResult;
import org.springframework.core.annotation.Order;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@Order(2)
@ControllerAdvice
public class BaseExceptionHandler {
    @ResponseBody
    @ExceptionHandler({Exception.class})
    public AjaxResult handelException(Exception e) {
        System.out.println(e);
        return AjaxResult.errorMsg("系统异常，请重试");
    }
}
